/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elevenHomework;

/**
 *
 * @author Administrator
 */

    
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Scanner;
 
public class ProblemF {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int n;
        int x;
        while(cin.hasNext()){
            n = cin.nextInt();
            if(n==0) return;
           HashMap<Integer,Integer> table = new HashMap<Integer,Integer>();
            for(int i=0; i<n; i++){
                x = cin.nextInt();
                table.put(x,table.containsKey(x)?table.get(x)+1:1);
            }
            for(Integer i:table.keySet()){
                if(table.get(i)==1)
                     System.out.println(i);
            }
        }
    }
}
